package com.syyo.gulimall.ware.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.syyo.gulimall.ware.domain.entity.WareSkuEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 *
 * @author syyo
 * @email syyo@gmail.com
 * @date 2021-01-20 10:06:54
 */
public interface WareSkuMapper extends BaseMapper<WareSkuEntity> {

    Long getSkuStock(Long skuId);

    List<Long> listWareIdHasStock(@Param("skuId") Long skuId);

    Integer lockSkuStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("num") Integer num);

    Integer unLockStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("num") Integer num);
}
